<template>
    <Boxtitle class='summary'>
        <template #title>
            <p>游客体验统计</p>
        </template>
        <template #content>
            <div class="chart" ref="chart"></div>
        </template>
    </Boxtitle>
</template>

<script setup lang="ts">
import * as echarts from 'echarts';
import Boxtitle from './slot/boxtitle.vue';
import {ref,onMounted} from 'vue'
let chart = ref()
onMounted(()=>{
    let mychart = echarts.init(chart.value);
    mychart.setOption(option);
})
let option = {
    legend: {
        data: ['青年游客', '中老年游客'],
        textStyle:{
            color: 'white'
        },
        right: 10
    },
    radar: {
        // shape: 'circle',
        indicator: [
            { name: '消费', max: 6500 },
            { name: '出行', max: 16000 },
            { name: '住宿', max: 30000 },
            { name: '体验', max: 38000 },
            { name: '风景', max: 52000 },
            { name: '娱乐', max: 25000 }
        ]
    },
    series: [
        {
            name: '游客体验',
            type: 'radar',
            data: [
                {
                    value: [4200, 3000, 20000, 35000, 50000, 18000],
                    name: '青年游客'
                },
                {
                    value: [5000, 14000, 28000, 26000, 42000, 21000],
                    name: '中老年游客'
                }
            ]
        }
    ]
};
</script>

<style scoped type="scss">
.summary {
    flex: 1;
    .chart{
        margin-top: 20px;
        height: 240px;
    }
}
</style>